package com.lengxf.pay.ali.service;

import com.alipay.api.domain.AlipayTradeAppPayModel;
import com.alipay.api.request.AlipayTradeAppPayRequest;
import com.lengxf.pay.ali.config.ALI_PayConfig;
import com.lengxf.pay.common.bean.PayOrder;

public record AliAppPayService(ALI_PayConfig aliPayConfig) {


    public AlipayTradeAppPayRequest appPay(PayOrder payOrder) {
        AlipayTradeAppPayRequest request = new AlipayTradeAppPayRequest();
        AlipayTradeAppPayModel model = new AlipayTradeAppPayModel();
        model.setOutTradeNo(payOrder.getOrderNo());
        model.setTotalAmount(String.valueOf(payOrder.getPrice()));
        model.setSubject(payOrder.getProductDesc());
        request.setBizModel(model);
        return request;
    }

}
